﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Admin.Master" AutoEventWireup="true" CodeBehind="Clients.aspx.cs" Inherits="Legazpi.Payroll.Web.Admin.Clients" %>


<asp:Content ID="Content3" ContentPlaceHolderID="leftContent" runat="server">
            <div class="grid_3">      
                <div class="module">
                    <h2><span>Add/Update Record Entry</span></h2>
                        
                    <div class="module-body">                      
                        <p>
                            <label>Code:</label>
                            <asp:TextBox ID="CodeTxt" runat="server" CssClass="input-long"></asp:TextBox>
                            <asp:HiddenField ID="ClientId" runat="server" />
                        </p>
                        <p>
                            <label>Firm Name:</label>
                            <asp:TextBox ID="FirmNameTxt" runat="server" CssClass="input-long"></asp:TextBox>
                        </p>
                        <p>
                            <label>Contact No:</label>
                            <asp:TextBox ID="ContactNoTxt" runat="server" CssClass="input-long"></asp:TextBox>
                        </p>
                        <p>
                            <label>Address:</label>
                            <asp:TextBox ID="AddressTxt" runat="server" CssClass="input-long"></asp:TextBox>
                        </p>
                        <p>
                            <label>Regular OT:</label>
                            <asp:TextBox ID="RegOTtxt" runat="server" CssClass="input-short"></asp:TextBox>
                        </p>
                        <p>
                            <label>Special OT:</label>
                            <asp:TextBox ID="SpclOTtxt" runat="server" CssClass="input-short"></asp:TextBox>
                        </p>
                        <p>
                            <label>Legal Holiday:</label>
                            <asp:TextBox ID="Legaltxt" runat="server" CssClass="input-short"></asp:TextBox>
                        </p>
                        <p>
                            <label>Special Holiday:</label>
                            <asp:TextBox ID="Spcltxt" runat="server" CssClass="input-short"></asp:TextBox>
                        </p>
                        <p>
                            <label>Night Diff:</label>
                            <asp:TextBox ID="NightDiffTxt" runat="server" CssClass="input-short"></asp:TextBox>
                        </p>
                        <fieldset>
                            <asp:Button id="SubmitBtn" runat="server" Text="Submit" CssClass="submit-green" 
                                onclick="AddNewBtn_Click" />                                                                                                            
                            <asp:Button id="CancelBtn" runat="server" Text="Cancel" CssClass="submit-gray" 
                                onclick="CancelBtn_Click" />                                                                                                            
                        </fieldset>
                        
                        
                     </div> <!-- End .module-body -->
                </div> <!-- End .module -->
                <div style="clear:both;"></div>                      		                                                               
            </div>
            <div class="grid_4">                
                <div class="module">
                     <h2><span>Sectors</span></h2>
                        
                     <div class="module-body">
                        <%if(CurrentClient != null){
                              foreach(var item in CurrentClient.Sectors) {%>                                                        
                                <a class="removable">[<%=item.Id %>] &nbsp;&nbsp; <%=item.Name %></a><br />
                        <%   }
                          } %>                                                 
                            <fieldset>
                                <asp:TextBox ID="SectorNameTxt" runat="server" CssClass="input-short"></asp:TextBox>&nbsp;&nbsp;
                                <asp:Button id="AddSectorBtn" runat="server" Text="Add Sector" 
                                    CssClass="submit-green" onclick="AddSectorBtn_Click" />                                                                                                                                            
                            </fieldset>
                        
                     </div>
                </div> <!-- module -->
                <div style="clear:both;"></div>
			</div>
            <div class="grid_5">
                <div class="module">
                 <h2><span>Detachments</span></h2>
                            <table width="100%" border="0" class="tablesorter">
                                <thead>                                                                            
                                    <th width="25%">Sector</th>
                                    <th width="15%">Position</th>
                                    <th width="10%">Work Hours</th>
                                    <th width="10%">Rate/Day</th>
                                    <th width="10%">Rate/Hour</th>                                
                                    <th width="10%"></th>
                                </thead>
                                <tbody>
                                <tr>                                    
                                    <td>
                                        <asp:DropDownList ID="SectorDropList" runat="server" Width="100%"></asp:DropDownList>
                                        <asp:HiddenField runat="server" ID="DetachmentId" Value="0" />
                                    </td>                                    
                                    <td><asp:DropDownList ID="PositionDropList" runat="server" Width="100%"></asp:DropDownList></td>                                    
                                    <td><asp:TextBox ID="WorkHourTxt" runat="server" CssClass="input-long"></asp:TextBox></td>                                    
                                    <td><asp:TextBox ID="RatePerDayTxt" runat="server" CssClass="input-long"></asp:TextBox></td>                            
                                    <td><asp:TextBox ID="RatePerHourTxt" runat="server" CssClass="input-long"></asp:TextBox></td>
                                    <td>                                        
                                        <asp:Button id="SubmitSectorBtn" runat="server" Text="Submit" 
                                            CssClass="submit-green" onclick="SubmitSectorBtn_Click" Enabled="False"/>                                
                                    </td>                                                   
                                </tr> 
                                </tbody>
                            </table>   

                        </div>  <!-- End .module -->     
            </div> 
            <div class="grid_5  ">
                <div class="module">
                             <h2><span>Detachments Table</span></h2>
                     
                             <div class="module-body">                                                         
                             <asp:Repeater ID="repeaterSector" runat="server" 
                                     OnItemCommand="repeaterSector_ItemCommand" 
                                     onitemdatabound="repeaterSector_ItemDataBound">
                                <HeaderTemplate>
                                    <table width="100%" border="0" class="tablesorter">
                                        <thead>
                                            <th>Sector</th>
                                            <th>Position</th>
                                            <th>Work Hours</th>
                                            <th>Rate/Day</th>
                                            <th>Rate/Hour</th>
                                            <th width="15%"></th>
                                        </thead>
                                        <tbody>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr class="odd">                                    
                                      <td>
                                        <asp:Literal runat="server" ID="SectorNameLiteral"></asp:Literal>
                                        <asp:HiddenField runat="server" ID="DetachmentIdHidden" Value="0" />
                                      </td>
                                      <td><asp:Literal runat="server" ID="PositionCodeLiteral"></asp:Literal></td>
                                      <td><asp:Literal runat="server" ID="WorkHourLiteral"></asp:Literal></td>
                                      <td><asp:Literal runat="server" ID="RateDayLiteral"></asp:Literal></td>
                                      <td><asp:Literal runat="server" ID="RateHourLiteral"></asp:Literal></td>                                                                  
                                        <td>                                        
                                            <asp:ImageButton ID="SaveLinkBtn" runat="server" ImageUrl="/images/pencil.gif" Width="16" Height="16" AlternateText="update" CommandName="update" CommandArgument=<%# Eval("Id")%> />
                                            <asp:ImageButton ID="DeleteLinkBtn" runat="server" ImageUrl="/images/bin.gif" Width="16" Height="16" AlternateText="delete" CommandName="delete"  CommandArgument=<%# Eval("Id")%> OnClientClick="return confirm('Confirm Delete?');" />                                        
                                        </td>
                                    </tr>                            
                                </ItemTemplate>
                                <AlternatingItemTemplate>
                                    <tr class="even">                                    
                                      <td>
                                        <asp:Literal runat="server" ID="SectorNameLiteral"></asp:Literal>
                                        <asp:HiddenField runat="server" ID="DetachmentIdHidden" Value="0" />
                                      </td>
                                      <td><asp:Literal runat="server" ID="PositionCodeLiteral"></asp:Literal></td>
                                      <td><asp:Literal runat="server" ID="WorkHourLiteral"></asp:Literal></td>
                                      <td><asp:Literal runat="server" ID="RateDayLiteral"></asp:Literal></td>
                                      <td><asp:Literal runat="server" ID="RateHourLiteral"></asp:Literal></td>                                                                  
                                        <td>                                        
                                            <asp:ImageButton ID="SaveLinkBtn" runat="server" ImageUrl="/images/pencil.gif" Width="16" Height="16" AlternateText="update" CommandName="update" CommandArgument=<%# Eval("Id")%> />
                                            <asp:ImageButton ID="DeleteLinkBtn" runat="server" ImageUrl="/images/bin.gif" Width="16" Height="16" AlternateText="delete" CommandName="delete"  CommandArgument=<%# Eval("Id")%> OnClientClick="return confirm('Confirm Delete?');" />                                        
                                        </td>
                                    </tr>                            
                                </AlternatingItemTemplate>
                                <FooterTemplate>
                                        </tbody>
                                    </table>
                                </FooterTemplate>
                             </asp:Repeater>                            
                                                   
                             </div> <!-- End .module-body -->

                </div>
            </div> 
            <div class="grid_9">
                <div class="module">
                    <h2><span>Clients Table</span></h2>
                     
                    <div class="module-body">                                                         
                    <asp:Repeater ID="repeater" runat="server" OnItemCommand="repeater_ItemCommand">
                    <HeaderTemplate>
                        <table width="100%" border="0" class="tablesorter">
                            <thead>
                                <th>Id</th>
                                <th>Code</th>
                                <th>Firm Name</th>
                                <th>Contact No</th>
                                <th>Address</th>
                                <th width="15%"></th>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr class="odd">                                    
                            <td><%# Eval("Id")%></td>
                            <td><%# Eval("Code")%></td>
                            <td><%# Eval("FirmName")%></td>
                            <td><%# Eval("ContactNo")%></td>                            
                            <td><%# Eval("Address")%></td>                                                                  
                            <td>                                        
                                <asp:ImageButton ID="SaveLinkBtn" runat="server" ImageUrl="/images/pencil.gif" Width="16" Height="16" AlternateText="update" CommandName="update" CommandArgument=<%# Eval("Id")%> />
                                <asp:ImageButton ID="DeleteLinkBtn" runat="server" ImageUrl="/images/bin.gif" Width="16" Height="16" AlternateText="delete" CommandName="delete"  CommandArgument=<%# Eval("Id")%> OnClientClick="return confirm('Confirm Delete?');" />                                        
                            </td>
                        </tr>                            
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class="even">                                    
                            <td><%# Eval("Id")%></td>
                            <td><%# Eval("Code")%></td>
                            <td><%# Eval("FirmName")%></td>
                            <td><%# Eval("ContactNo")%></td>                            
                            <td><%# Eval("Address")%></td>                                                                  
                            <td>                                        
                                <asp:ImageButton ID="SaveLinkBtn" runat="server" ImageUrl="/images/pencil.gif" Width="16" Height="16" AlternateText="update" CommandName="update" CommandArgument=<%# Eval("Id")%> />
                                <asp:ImageButton ID="DeleteLinkBtn" runat="server" ImageUrl="/images/bin.gif" Width="16" Height="16" AlternateText="delete" CommandName="delete"  CommandArgument=<%# Eval("Id")%> OnClientClick="return confirm('Confirm Delete?');" />                                        
                            </td>
                        </tr>                            
                    </AlternatingItemTemplate>
                    <FooterTemplate>
                            </tbody>
                        </table>
                    </FooterTemplate>
                    </asp:Repeater>                            
                                                   
                    </div> <!-- End .module-body -->

            </div>  <!-- End .module -->     
            </div> 
</asp:Content>